package com.xyf.sys.mapper;

import com.xyf.sys.domain.UserRole;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface UserRoleMapper {
    int deleteByPrimaryKey(UserRole key);

    int insert(UserRole record);

    int insertSelective(UserRole record);

    UserRole select(@Param("userId") String userId, @Param("roleId") Long roleId);

    List<UserRole> selectUserRole(@Param("userId") String userId);

    List<UserRole> selectDeptRole(@Param("userId") String userId, @Param("deptId") Long deptId);

    List<UserRole> selectRole(@Param("deptId") Long deptId);

    void deleteByUserId(@Param("userId") String userId);

    void deleteByDeptId(@Param("deptId") Long deptId);

    List<UserRole> selectAll();

    void update(UserRole userRole);

    List<UserRole> selectUserDefaultRole(@Param("userId") String userId, @Param("deptId") Long deptId);
}